{{template "header"}}
<title>{{.Topicinfo.Title}}——我的11go_http</title>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
    {{template "nav" .}}


    {{$islogin := .IsLogin}}
    <div class="container">

        {{$labels := .Labels}}
        {{with .Topicinfo}}
        <h1>{{.Title}}</h1>
        {{if $islogin}}
        <a href="/topic/modify?tid={{.Id}}" class="btn-default"><input type="button" value="去修改文章"></a>
        {{end}}
                <h5>
                    {{range $labels}}
                        <a href="/?label={{.}}">{{.}}</a>
                    {{end}}
                </h5>

        <div class="form-group">
            {{.Content}}

            <h5>
               文章附件： <a href="/attachment/{{.Attachment}}">{{.Attachment}}</a>
            </h5>
        </div>


        {{end}}
    </div>
    <div class="container">

        <h3>本文评论列表</h3>

        {{$tid := .Topicinfo.Id}}

        {{range  .Replies}}
        <h4>{{.Name}} <small>{{.Created |mydateform}}</small>

            {{if $islogin}}
            <a href="/reply/del?tid={{$tid}}&rid={{.Id}}"> 删除</a></h4>
            {{end}}
        <div class="form-group">
            {{.Content}}
        </div>
        {{end}}

        <h3>立刻评论</h3>
        <form method="post" action="/reply/add">
            <input type="hidden" name="tid" value="{{.Topicinfo.Id}}">

            <div class="form-group">
                <label >显示昵称</label>
                <input type="text" class="form-control" name="nickname">

            </div >


            <div class="form-group">
                <label >评论内容</label>
                <textarea name="content" id="" cols="30" rows="10" class="form-control"></textarea>
            </div>

            <button class="btn btn-default">提交回复</button>

        </form>

    </div>

    <script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="/static/plugin/bootstrap/dist/js/bootstrap.js"></script>

</nav></body>
</html>
